import java.util.Random;
import java.util.Scanner;
public class 猜数字游戏 {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        while (true){
            System.out.println("+-----------------------------+");
            System.out.println("|                             |");
            System.out.println("|          猜数字游戏           |");
            System.out.println("|                             |");
            System.out.println("+-----------------------------+");
            System.out.print("1. 开始游戏\n0. 退出游戏\n请输入1 or 0：");
            int a = input.nextInt();
            switch(a){
                case 1:
                    Random random = new Random();
                    int b = random.nextInt(100) + 1;
                    while (true){
                        System.out.print("请输入一个1~100的数：");
                        int c = input.nextInt();
                        if (c > b){
                            System.out.println("猜大了！！！");
                        } else if(c < b){
                            System.out.println("猜小了！！！");
                        } else{
                            System.out.println("嗨，你他娘的真是个天才！！！");
                            break;
                        }
                    }
                    break;
                case 0:
                    System.out.println("退出游戏");
                    System.exit(0);
            }
        }
    }
}
